-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tracking with OpenCV #1003
Add Tracking with OpenCV #1003
Conversation
Add enginePlugin.js with Tracker MVC. Modify ShapeModel: Each position has the property byMachine. If this is true, this means the position created by the tracker and not the user. This is used to let the tracker later change positions of shapes again until the next manually inserted key frame.
@mistermult , thanks for the contribution! It is a feature which our community waits. I can see some problems. Let's fix them first and after that discuss how to improve the feature futher.
|
Automatically install GOTRUN models for OpenCV tracker in docker container if TRACKING is set to 'yes', which is done in the file docker-compose.tracking.yml.
Thank you for your response. I integrated the tracking into the docker container. Please try to run it with: # Maybe try to rebuild form ground up to install all packages (?)
docker-compose -f docker-compose.yml -f components/tracking/docker-compose.tracking.yml build --no-cache
# And run
docker-compose -f docker-compose.yml -f components/tracking/docker-compose.tracking.yml up The above works in the container. Your error message indicates that the opencv-contrib-python package is not installed or not found. It should be installed in the container because it is listed in the base.txt requirements file. EDIT: @nmanovic I can confirm your error. I tried to enable tracking and OpenVINO at the same time with: docker-compose -f docker-compose.yml -f components/openvino/docker-compose.openvino.yml -f components/tracking/docker-compose.tracking.yml build --no-cache
docker-compose -f docker-compose.yml -f components/openvino/docker-compose.openvino.yml -f components/tracking/docker-compose.tracking.yml up The reason is that installing OpenVINO seems to change the OpenCV version. Especially it disables or removes opencv-contrib-python with the trackers. This is confirmed by getting a shell into the container, running python3, and getting the version I suggest fixing this at the end. If nothing works, tracking or OpenVINO can run in another container. |
This adds the instuctions to install and activate tracking in dev mode.
@bsekachev @nmanovic Is there anything else to do for me regarding this PR? |
@mistermult , thanks again for the contribution. Please give us some time to review the PR and give you a feedback. Happy New Year! |
@mistermult @nmanovic We tested tracking on Onepanel and it seems to work fine without any error. |
Im getting an issue with saving the annotations. Ive tested with brand new tasks and tasks I had before pulling this fork. I get two distinct errors from a bit of testing.
The errors are the same across old tasks and new tasks. Im a junior dev so I will try to debug a little but no promises on results. Let me know if you'd like any more information |
@tetther1122 I fixed it quickly. It was a copy-paste-error. But I cannot test it right now. |
@mistermult tested. Result: it worked. Thanks, I'll let you know if I come across anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look on comments below.
Disclaimer: I'm not CVAT developer, so I don't know all project details. It is just a view from OpenCV integration perspective.
MEDIANFLOW: 'MEDIANFLOW', | ||
TLD: 'TLD', | ||
MOSSE: 'MOSSE', | ||
GOTRUN: 'GOTRUN', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
opencv-python==4.1.0.25 | ||
opencv-contrib-python==4.1.2.30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one package should be installed.
Installing both packages is leading to conflicts.
@@ -23,4 +23,8 @@ __pycache__ | |||
# Ignore development npm files | |||
node_modules | |||
|
|||
# Ignore goturn model | |||
goturn.caffemodel | |||
goturn.prototxt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this model is very large. So placing it in source tree would lead to docker builds slowdown.
What is about .dockerignore
? (if you want to add it where)
Or remove from both places.
- Download the GOTURN model if the the OpenCV GOTURN tracker is to be used. | ||
```sh | ||
#This downloads it into the cvat folder | ||
components/tracking/install.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
into the cvat folder
Root directory doesn't look as a right place.
I believe it make sense to download it into appropriate places, likecomponents/tracking/model
.
Or take a look in a direction (investigate) of using docker volumes / mounted shares with large models.
ENV TRACKING=${TRACKING} | ||
ENV TRACKING_PATH=${HOME}/tracking | ||
RUN if [ "$TRACKING" = "yes" ]; then \ | ||
bash -i /tmp/components/tracking/install.sh; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking may be used without GOTURN.
Consider making using of GOTURN model optional.
BTW, There is some issue with GOTURN model inference in OpenCV DNN: opencv/opencv_contrib#2426 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mistermult , need to adopt the patch to our new UI. If you can help it will be awesome. @Priya4607 , are you going to help here?
I'm having trouble getting the tracking to run. I ran the commands suggested earlier:
But the second command seems to never terminate and occasionally logs this error: |
I tried to copy manually each of the new files and run the tracker. It seems to work (I have the tracker options in the settings etc) but when I right click and press track I get the following error : Error: Could not track shape. Code: 405. Message: <title>405 Not Allowed</title> 405 Not Allowednginx/1.16.1 <!-- a padding to disable MSIE and Chrome friendly error pag |
@nmanovic @azhavoro If I use the "Track" box then it places a bounding box in every frame. But the user typically runs tracking on some number frames. So if I run tracking on "Track" box then it has two boxes for frames that user-selected and one Track box in the remaining frames which shouldn't be there.. To solve this issue, we are using tracking on "Shape" box. I am not sure if that's the right thing to do. If you can provide some advice on how can we remove those boxes from other frames, then I can update it to use Track rather than the Shape. here is a code from this (old ui) PR that might be relevant
|
@san999p ,
Please let me know if the explanation isn't clear. Does it look right? |
@mistermult , thanks again for the great PR. We are going to port it into new UI. I will close the PR because the old UI is going to be removed soon. |
Thanks @nmanovic I will update the backend when I get some time. Would it be okay if we send PR for just UI? |
Here is the promised tracking feature. It works, see the video (https://streamable.com/jmq72).
There are still some open TODOs for which I need some feedback:
The tracking component is enabled by default.Tracking is enabled by environment variable TRACKING. Ok?